/*
 *    Copyright (c) 2018-2025, cloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: cloud
 */

package com.fuyao.cloud.asset.dto.borrow;

import cn.hutool.core.lang.tree.Tree;
import com.fuyao.cloud.asset.entity.borrow.BorrowList;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.apache.commons.compress.utils.Lists;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 借用&归还表
 *
 * @author ly
 * @date 2022-01-06 10:37:40
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class BorrowCreateDTO {

	@ApiModelProperty(value="主键Id")
	private Long id;

	@ApiModelProperty(value="单位、部门ID")
	private Long deptId;

	@ApiModelProperty(value="部门全名称")
	private String deptFullname;

	@ApiModelProperty(value="创建人")
	private String createBy;

	@ApiModelProperty(value="创建人ID")
	private Long createId;

	@ApiModelProperty(value="创建时间")
	private LocalDateTime createTime;

	@ApiModelProperty(value="修改人")
	private String updateBy;

	@ApiModelProperty(value="修改时间")
	private LocalDateTime updateTime;

	@ApiModelProperty(value = "唯一编码（用于关联附件）")
	private String unid;

	@ApiModelProperty(value = "单号")
	private String caseid;

	@ApiModelProperty(value="状态：默认为0{0:已生效，1:审批中，2:待签字，3:已驳回}")
	private String status;

	@ApiModelProperty(value = "默认为0{0：借用、1：归还}")
	private String type;

	@ApiModelProperty(value = "借用人ID")
	private Integer borrowId;

	@ApiModelProperty(value = "借用人姓名")
	private String borrowName;

	@ApiModelProperty(value = "借用人所属OU的ID")
	private Integer borrowOuid;

	@ApiModelProperty(value = "借用人所属OU的全称")
	private String borrowOufullname;

	@ApiModelProperty(value = "借用人所属OU的名称")
	private String borrowOuname;

	@ApiModelProperty(value = "归还人ID")
	private Integer remandId;

	@ApiModelProperty(value = "归还人姓名")
	private String remandName;

	@ApiModelProperty(value = "归还人所属OU的ID")
	private Integer remandOuid;

	@ApiModelProperty(value = "归还人所属OU的全称")
	private String remandOufullname;

	@ApiModelProperty(value = "归还人所属OU的名称")
	private String remandOuname;

	@ApiModelProperty(value = "借用时间")
	private LocalDateTime borrowTime;

	@ApiModelProperty(value = "预计归还时间")
	private LocalDateTime forecastRemandTime;

	@ApiModelProperty(value = "实际归还时间")
	private LocalDateTime realRemandTime;

	@ApiModelProperty(value = "说明")
	private String explains;

	@ApiModelProperty(value="订单明细")
	private String detailed;

	@ApiModelProperty(value="借用明细")
	private List<BorrowList> borrowList;

	@ApiModelProperty(value = "字典集合")
	private BorrowCreateDTO.DictOption dictOption;

	@Data
	public static class DictOption{
		@ApiModelProperty(value="用户树集合")
		private List<Tree<Integer>> userTreeList = Lists.newArrayList();
	}

}
